package com.jacobson.core.utils

/**
 * ================================================
 *
 * @author Wucz on 2018/7/16 9:17
 * ================================================
 */

class Preconditions {

    companion object {
        fun checkNonNull(obj: Any?, msg: String? = "Must be non null") {
            if (obj == null) {
                throw NullPointerException(msg)
            }
        }
        fun checkState(flag: Boolean, msg: String ?= "Illegal State") {
            if (!flag) {
                throw IllegalStateException(msg)
            }
        }
    }
}